<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>新建工单</title>
    <meta name="keywords" content="">
    <meta name="description" content="">
    <include file="Index/common_css"/>
    <link href="__PUBLIC__/admin/css/plugins/iCheck/custom.css" rel="stylesheet">
    <link href="__PUBLIC__/common/css/dataTables.bootstrap.css" rel="stylesheet">
</head>

<body class="gray-bg">
    <div class="wrapper wrapper-content animated fadeInRight">
    <div class="row">
        <div class="col-sm-12">
            <div class="ibox float-e-margins">
                <div class="ibox-title">
                    <h5>新建工单</h5>

                </div>
                <div class="ibox-content">
                    <form class="form-horizontal m-t" id="signupForm" method="post" enctype="multipart/form-data">
                        <div class="form-group">
                            <label class="col-sm-3 control-label">工单类型：</label>
                            <div class="col-sm-8">
                                <select  class="form-control" name="type" id="type" class="valid" >
                                    <option value="1">账号类</option>
                                    <option value="2">资金类</option>
                                    <option value="3">操作类</option>
                                    <option value="4">申请类</option>
                                </select>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">标题：</label>
                            <div class="col-sm-8">
                                <input id="title" name="title" maxlength="15" class="form-control" type="text" required="" aria-required="true">
                                <span class="help-block m-b-none"><i class="fa fa-info-circle"></i> 简要阐述内容</span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">详细说明：</label>
                            <div class="col-sm-8">
                                <textarea id="content" name="content" style="height: 180px;"  maxlength="255" placeholder="255个字符内" class="form-control" type="text" required="" aria-required="true"></textarea>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">图片：</label>
                            <div class="col-sm-8">
                                <input id="file" name="file" class="form-control" type="file" >
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">图片：</label>
                            <div class="col-sm-8">
                                <input id="file2" name="file2" class="form-control" type="file" >
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-sm-3 control-label">图片：</label>
                            <div class="col-sm-8">
                                <input id="file3" name="file3" maxlength="15" class="form-control" type="file" >
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">E-mail：</label>
                            <div class="col-sm-8">
                                <input id="email" name="email" value="{$user.user_email}" class="form-control" type="email" required="" aria-required="true">
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-sm-3 control-label">手机号：</label>
                            <div class="col-sm-8">
                                <input id="phone" name="phone" maxlength="11" value="{$user.user_phone}" class="form-control" type="text"  pattern="^1[3-9]\d{9}$" required>
                            </div>
                        </div>

                        <div class="form-group">
                            <div class="col-sm-8 col-sm-offset-3">
                                <button class="btn btn-primary" type="submit" id="submit">提交</button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
    </div>

</div>
<!-- 全局js -->
<include file="Index/common_js"/>
<!-- Peity -->
<!--<script src="__PUBLIC__/admin/js/plugins/peity/jquery.peity.min.js"></script>-->
<!-- 自定义js -->
<script src="__PUBLIC__/admin/js/content.js?v=1.0.0"></script>
<!--<script src="__PUBLIC__/common/js/layer_show.js"></script>-->
<script src="__PUBLIC__/admin/js/plugins/layer/laydate/laydate.js"></script>
<script src="__PUBLIC__/admin/js/plugins/validate/jquery.validate.min.js"></script>
<script src="__PUBLIC__/admin/js/plugins/validate/messages_zh.min.js"></script>
<!--<script src="__PUBLIC__/user/js/work_add.js"></script>-->
    <script type="text/javascript">
        $().ready(function () {
            var title = $("#title").val();
            var content = $("#content").val();
            var email = $("#email").val();
            var phone = $("#phone").val();
            if(title && content && email && phone ){
                $("#submit").on('click',function () {
                    var index = layer.load(0, {shade: false});
                    var form = document.getElementById('signupForm');
                    fdata = new FormData(form);
                    XHR = new XMLHttpRequest();
                    XHR.open('POST','__MODULE__/WorkOrder/WorkOrder_add',true);
                    XHR.onreadystatechange=function(){
                        if(XHR.readyState == 4) {
                            layer.close(index);layer.msg(XHR.responseText, {time: 1000});
                            setTimeout(function () {location.reload();}, 1100);
                        }
                    };
                    XHR.send(fdata);
                })
            }
        });
    </script>
</body>
</html>
